#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact  george.drettakis@inria.fr
#

from argparse import Namespace

from modules.hparam import HyperParams_SH


class HyperParams(HyperParams_SH):

    def __init__(self):
        super().__init__()

        # schedule
        self.densify_from_iter = 500
        self.densify_until_iter = 25000
        self.densification_interval = 100
        self.densification_resample_interval = 1000
        self.densify_grad_threshold = 0.0002

        # resample from SfM as init/incr points
        self.resample_ratio = 0.1
        self.resample_init_count_min = 5000
        self.resample_init_count_max = 15000
        self.resample_incr_count_min = 1000
        self.resample_incr_count_max = 10000

        # lr decay between Aeons
        self.aeon_lr_decay = 10

    def extract_from(self, args:Namespace):
        super().extract_from(args)

        assert self.densification_resample_interval >= self.densification_interval
